<include file="Public:header" />
<div id="zoneHeader">
    <h2>查看计划信息</h2>
    <ul>
        <li><a href="?m={$Think.const.MODULE_NAME}&a=modify&id={$record.planid}" class="btn">编辑</a></li>
        <li><a href="?m={$Think.const.MODULE_NAME}" class="btn">返回</a></li>
    </ul>
</div><!--/#zoneHeader-->
<style>
/**
 * 投放设备
 */
.showDevice {}
.showDevice label, .showDevice span b { min-width:80px; display:inline-block; }
.showDevice span b { text-align:right; }

</style>
<div id="zoneBody" class="noFooter">
    <div id="zoneBodyContent">
        <form action="?m={$Think.const.MODULE_NAME}&a=doSave" id="formEdit">
            <input type="hidden" name="planid" />
            <table class="table3" style="margin:auto;width:auto">
                <tr>
                    <td width="100" align="right">计划编号：</td>
                    <td width="200"><span name="planid"></span></td>
                    <td width="100" align="right">所属广告主：</td>
                    <td width="150"><span name="username"></span></td>
                    <td width="100" align="right"></td>
                    <td width="200"></td>
                </tr>
                <tr>
                    <td width="100" align="right">计划名称：</td>
                    <td width="200"><input name="planname" type="text" class="fW90" /></td>
                    <td width="100" align="right">记费形式：</td>
                    <td width="150">
                        <select name="plantype">
                            <volist name=":C('PLAN_TYPE')" id="vo" >
                            <option value="{$vo|strtolower}">{$vo|strtoupper}</option>
                            </volist>
                        </select>
                    </td>
                    <td width="100" align="right"><span >计划状态： </span></td>
                    <td width="200">
                        <select name="status">
                            <volist name=":C('PLAN_STATUS')" id="vo">
                            <option value="{$key}">{$vo}</option>
                            </volist>
                        </select>
                    </td>
                </tr>
                <tr>
                  <td align="right">投放设备：</td>
                  <td colspan="5">
                      <span>注：单价单位是：元/1000IP</span>
                      <table style="width:100%">
                          <tr>
                              <td style="width:120px">设备</td>
                              <td>网址</td>
                              <td style="width:50px">*广单价</td>
                              <td style="width:50px">*站单价</td>
                              <td style="width:50px">扣量</td>
                              <td style="width:50px">量比</td>
                          </tr>
                          <volist name=":getPlanDevices()" id="vo">
                          <tr>
                              <td><label><input type="checkbox" name="pd_device[]" value="{$key}" /><span>{$vo}</span></label></td>
                              <td><input type="text" name="pd_url_{$key}" style="width:95%" /></td>
                              <td><input type="text" name="pd_price_{$key}_1" class="fW90" /></td>
                              <td><input type="text" name="pd_price_{$key}_3" class="fW90" /></td>
                              <td><input type="text" name="pd_deduction_{$key}" class="fW50" /> %</td>
                              <td><input type="text" name="pd_flow_scale_{$key}" class="fW50" /> %</td>
                          </tr>
                          </volist>
                      </table>
                  </td>
                </tr>
                <tr >
                    <td align="right">结算周期:<br></td>
                    <td>
                        <label><input type="radio" name="clearing" value="day" /><span>日结</span></label>
                        <label><input type="radio" name="clearing" value="week" /><span>周结</span></label>
                        <label><input type="radio" name="clearing" value="month" /><span>月结</span></label>
                    </td>
                    <td align="right" >日限额：<br></td>
                    <td>
                        <input type="text" name="budget" id="budget" class="fW50"> 元
                        <p class="formNotice">留空表示不限额</p>
                    </td>
                    <td align="right" >结束日期：<br></td>
                    <td>
                        <input type="text" name="expire" />
                        <p class="formNotice">留空表示永不过期</p>
                    </td>
                </tr>
                <tr >
                    <td align="right" valign="top">定向投放时间:<br></td>
                    <td colspan="5" valign="top">
                        <p>
                        <label><input type="radio" name="time_limit" value="-1" /><span>不限制</span></label> 
                        <label><input type="radio" name="time_limit" value="1" /><span>在选定时段投放</span></label>
                        <label><input type="radio" name="time_limit" value="0" /><span>在选定时段禁止投放</span></label>
                        </p>
                        <ul id="timeLimitList">
                            <for start="0" end="24">
                            <li><label><input type="checkbox" name="time_limit_item[]" value="{$i}"/><span>{$i}:00 - {$i}:59</span></label></li>
                            </for>
                        </ul>
                    </td>
                </tr>
                <tr >
                    <td align="right" valign="top">定向投放星期:<br></td>
                    <td colspan="5" valign="top">
                        <p>
                            <label><input type="radio" name="week_day_limit" value="-1" /><span>不限制</span></label> 
                            <label><input type="radio" name="week_day_limit" value="1" /><span>在选定时段投放</span></label>
                            <label><input type="radio" name="week_day_limit" value="0" /><span>在选定时段禁止投放</span></label>
                        </p>
                        <ul id="weekDayLimitList">
                            <volist name=":C('WEEK_DAY')" id="vo">
                            <li><label><input type="checkbox" name="week_day_limit_item[]" value="{$key}"/><span>{$vo}</span></label></li>
                            </volist>
                        </ul>
                    </td>
                </tr>
                <tr >
                    <td align="right" valign="top">定向网站类型:<br></td>
                    <td colspan="5" valign="top">
                        <p>
                        <label><input type="radio" name="site_type_limit" value="-1" /><span>不限制</span></label> 
                        <label><input type="radio" name="site_type_limit" value="1" /><span>在选定网站类型中投放</span></label>
                        <label><input type="radio" name="site_type_limit" value="0" /><span>在选定网站类型中禁止投放</span></label>
                        </p>
                        <div id="siteTypeLimitList" class="siteTypeList">
                        <volist name=":getSiteTypeByPid()" id="vo">
                        <dl>
                            <dt>{$vo['name']}</dt>
                            <dd>
                            <ul>
                                <volist name=":getSiteTypeByPid($vo['id'])" id="v2">
                                <li><label><input type="checkbox" name="site_type_limit_item[]" value="{$v2['id']}" /><span>{$v2['name']}</span></label></li>
                                </volist>
                            </ul>
                            </dd>
                        </dl>
                        </volist>
                        </div><!--/#siteTypeLimitList-->
                    </td>
                </tr>
                <tr >
                    <td align="right" valign="top">限制投放的站长:<br></td>
                    <td colspan="5" valign="top">

<style type="text/css">
#siterLimitListContainer {}
#siterLimitListContainer ul { overflow:auto; }
#siterLimitListContainer li { float:left; min-width:80px; }
</style>
                        <div id="siterLimitListContainer"></div> <!--/#siterLimitListContainer--> 
                    </td>
                </tr>
            </table>
            <ul class="btnList">
                <li><a href="?m={$Think.const.MODULE_NAME}" class="btn">返回</a></li>
            </ul>
        </form>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->
<script>
$(function(){
    <notempty name="record">
    var record = {$record|json_encode};
    record.addtime='{:date("Y-m-d H:i:s", $record['addtime'])}';
    record.price = {:getPrice2($record['price'])};
    record.priceadv = {:getPrice2($record['priceadv'])};
    record.priceagent = {:getPrice2($record['priceagent'])};

    <notempty name="record.url">
    record.url_1 = '{$record.url}';
    </notempty>

    <notempty name="record.url2">
    record.url_2 = '{$record.url2}';
    </notempty>

    Conf.set('formEditDao', record);
    </notempty>

    Plan.LimitOption.init();

    var $form = $('#formEdit');

    $form.find('input, select').attr('readonly', true);

    var limitSiter = {$limitSiter|json_encode};
    Conf.set('planLimitSiter', limitSiter);
})
</script>
<script type="text/javascript" src="Tpl/Js/app.js"></script>
<include file="Public:footer" />
